1. Field of the Invention
The present invention relates to computing systems. More specifically, the present relates to a method and an apparatus for debugging a platform-independent virtual machine within a computer system.
2. Related Art
Computer programs written in languages such as the JAVA™ programming language are compiled into a platform-independent code, which is executed on a platform-independent virtual machine, such as a JAVA VIRTUAL MACHINE™ (JVM). A program that has been compiled into a platform-independent code has the advantage that it can execute on a platform-independent virtual machine regardless of the underlying central processing unit and native code. The terms JAVA, JVM and JAVA VIRTUAL MACHINE are trademarks of SUN Microsystems, Inc. of Palo Alto, Calif.
A platform-independent virtual machine is typically customized to fit in the memory of the computing device without adversely affecting the memory available for applications. For example, a platform-independent virtual machine on a small device such as a personal digital assistant (PDA) has few if any optional features while a platform-independent virtual machine on a desktop computer or mainframe computer may have many options and include a just-in-time (JIT) compiler.
Customizing the platform-independent virtual machine for a different computing device is commonly termed “porting” the platform-independent virtual machine. Porting the platform-independent virtual machine to a different computing device can be difficult, particularly for a small device such as a PDA, because there are few, if any, debugging programs and devices available to aid in the porting process.
Because of the lack of debugging facilities, an analyst typically inserts print statements into the code for the virtual machine at various places to try to determine the state of variables within the platform-independent virtual machine. This is a trial-and-error process, in which the analyst examines a few variables and then decides which other variables to examine. Each iteration involves changing the source code for the platform-independent virtual machine, recompiling the code, downloading the executable code to the target machine, and running the new executable code. This is a time-consuming process and detracts from the analyst's concentration in locating the problem. Additionally, inserting print statements into the code can affect the operation of the code in such a way that the problem is masked.
What is needed is a method and an apparatus that allows an analyst to view the state of variables within a platform-independent virtual machine without the problems listed above.